package com.glh.javalogic.chapter4.concept;

/**
 * author : 高磊华
 * e-mail : 984992087@qq.com
 * time   : 2018\6\9
 * desc   : 圆
 */

public class Circle extends Shape {
    //中心点
    private Point center;

    //半径
    private double r;

    public Circle(Point center, double r) {
        this.center = center;
        this.r = r;
    }

    @Override
    public void draw() {
        System.out.println("draw circle at "
                + center.toString() + " with r " + r
                + ", using color : " + getColor());
    }

    public double area() {
        return Math.PI * r * r;
    }

}


